package org.base23.video.repository;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.base23.video.domain.entity.UserAnalysisResult;
import org.base23.video.mapper.UserAnalysisResultMapper;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 用户分析结果Repository
 */
@Repository
public class UserAnalysisResultRepository extends ServiceImpl<UserAnalysisResultMapper, UserAnalysisResult> {

    /**
     * 根据用户ID查询分析结果列表
     */
    public List<UserAnalysisResult> findByUserId(Long userId) {
        return baseMapper.selectByUserId(userId);
    }

    /**
     * 根据用户ID和结果ID查询
     */
    public UserAnalysisResult findByUserIdAndResultId(Long userId, String resultId) {
        return baseMapper.selectByUserIdAndResultId(userId, resultId);
    }

    /**
     * 根据用户ID和运动类型查询
     */
    public List<UserAnalysisResult> findByUserIdAndSportType(Long userId, String sportType) {
        return baseMapper.selectByUserIdAndSportType(userId, sportType);
    }
} 